{include file=$header_start}
{strip}
<script type="text/javascript" src="{$siteroot}/includes/js/admin/settings.js" /></script>
{/strip}
{literal}
<script language="javascript">
function showPermission(val){
	if(val != '') {
		window.location.href = SITEROOT+'/admin/home.php?q=permissions&id='+val;
	} else {
		alert('Select admin user');
		return false;
	}
}
</script>
{/literal}
{include file=$header_end}
<div class="contain">
      {include file=$left_menu}
      <div class="right_contain">
         <div class="heading_box">Set Permissions</div>
         <div class="whitebox">
         
         <!--Message Div Start-->
         {if $msg}
         <div class="masg_div">
         	{$msg}
         </div>
         {/if}
         <!--Message Div End-->
         
         <div>
          <!--Form Contain start-->
           
           <div class="table_viewbox">
           <br />
              <form name="searchFrm" id="searchFrm" method="post" action="">
            	<table width="100%" border="0" cellpadding="3" cellspacing="5">
                	<tr>
                    	<td align="left" width="50%">Using this settings admin can set modules permissions to admin users.</td>
                        <td align="right" width="50%">
                        <select class="input41_selet" name="userid" onchange="javascript: showPermission(this.value);" style="width:50%">
                        <option value="">Select Admin User</option>
                        {section name=i loop=$userArray}
                        <option value="{$userArray[i].id|base64_encode}" {if $userArray[i].id|base64_encode eq $smarty.get.id} selected="selected" {/if}>{$userArray[i].first_name|ucfirst}&nbsp;{$userArray[i].last_name|ucfirst}</option>
                        {/section}
                        </select>
                        </td>
                    </tr>
                </table>
            </form>
             <br />
            <form name="frm" id="frm" action="" method="post" >
            <input type="hidden" name="hidden_userid" id="hidden_userid" value="{$smarty.get.id}" />

            <input type="hidden" name="checkedvalue" id="checkedvalue" value="{$checkedvalue}" />
            
            <table width="100%" border="0" cellspacing="0" cellpadding="0" class="table_viewbox">
              <tr>
                <th width="6%" align="center">#</th>
                <th width="6%"><input type="checkbox" name="check" id="check" {if $uncheckedvalue eq '1'} checked="checked" {/if}  /></th>
                <th width="88%">Module</th>
                
              </tr>
              {section name=i loop=$modules}
              <tr class="{if $modules[i].perm_status eq '1'}activerow{else}inactiverow{/if}" id="tr_{$modules[i].module_id}">
                <td align="center">{$smarty.section.i.iteration}</td>
                <td><input type="checkbox" name="checkall[]" id="checkall_{$smarty.section.i.iteration}" value="{$modules[i].module_id}" {if $modules[i].perm_status eq '1'} checked="checked" {/if} /></td>
                <td>{$modules[i].module_name}</td>
                
              </tr>
              {/section}
               <tr>
                <td colspan="4">
                
                <div class="select_box">
	               <input type="submit" class="admin_btn" value="Update" name="update" id="update" />
                   
                   <input type="button" class="admin_btn" value="Back" name="Back" id="Back" onclick="javascript: history.go(-1);" />
                   <div id="errormsg" class="error"></div> 
                </div>
                </td>
              </tr>
            </table>
</form>
            

         </div>
            <!--Form Contain end--> 
          
         </div>
         
         
         </div>
        </div>
      
      
      <!--right_contain end-->
      <div class="clear"></div>
    </div>
    
{include file=$footer}